import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [

  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  },
  {
    path: '/Home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    meta: {
      title: '',
      requireAuth: true,
    }, children: [
      {
        path: '/biding',
        name: 'biding',
        component: () => import('../views/biding.vue')
      },
      {
        path: '/Finance',
        name: 'Finance',
        component: () => import('../views/Finance.vue')
      },
      {
        path: '/Logistics',
        name: 'Logistics',
        component: () => import('../views/Logistics.vue')
      },
      {
        path: '/order',
        name: 'order',
        component: () => import('../views/order.vue')
      },
      {
        path: '/Product',
        name: 'Product',
        component: () => import('../views/Product.vue')
      },
      {
        path: '/set',
        name: 'set',
        component: () => import('../views/set.vue')
      },


      {
        path: '/registerSupplier',
        name: 'registerSupplier',
        component: () => import('../views/registerSupplier.vue')
      }, {
        path: '/examineAndVerify',
        name: 'examineAndVerify',
        component: () => import('../views/examineAndVerify.vue')
      },
      {
        path: '/changeSupplierInfo',
        name: 'changeSupplierInfo',
        component: () => import('../views/changeSupplierInfo.vue')
      },
      {
        path: '/logoutSupplier',
        name: 'logoutSupplier',
        component: () => import('../views/logoutSupplier.vue')
      },
      {
        path: '/changePassword',
        name: 'changePassword',
        component: () => import('../views/changePassword.vue')
      },
      {
        path: '/RegisteredSupplierEntry',
        name: 'RegisteredSupplierEntry',
        component: () => import('../views/RegisteredSupplierEntry.vue')
      },



    ]

  },

  // {
  //   //导航栏
  //   path: '/Navigation',
  //   name: 'Navigation',
  //   component: () => import('../components/Navigation.vue')
  // },
  //



  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
